package com.scientific.research.gobang.controller;

import com.scientific.research.gobang.service.RobotService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RequestMapping("CodeGame")
@RestController//Rest是让所有方法的返回值都是JSON格式
public class RobotController {
    @Resource(name = "robotServiceImpl")
    RobotService robotService;

    @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
    @RequestMapping("ManAndRobot")
    public Map ManAndRobot(@RequestBody Map jsonResponse) {
        return robotService.ManAndRobot(jsonResponse);
    }

    @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
    @RequestMapping("afterLoadRobot")
    public Map AfterLoadRobot(@RequestBody Map map) {
        return robotService.AfterLoadRobot(map);
    }

    //编译人机代码
    @SuppressWarnings("AlibabaLowerCamelCaseVariableNaming")
    @RequestMapping("LodeRobotCode")
    public String LodeRobotCode(@RequestBody Map map) {
        return robotService.LodeRobotCode(map);
    }
}
